# this script selects all combinations files in the constellation folder 
# and creates a knitr report on them.

library(knitr)

path <- "/home/voellenk/Dropbox/constellation/combinationFiles"
outp <- "/home/voellenk/Dropbox/constellation/report"
knitfile <- "/home/voellenk/stratlab_workdir/stratlab/pattern_report/bestPatterns.Rmd"

all.files <- list.files(path, rec=F)
comb_files <- all.files[grep('^v2_2.*_C.Rdata$', all.files)]

for (i in 1:length(comb_files)) {
  filename <- comb_files[i]
  print (paste("... doing", filename))
  knit2html(knitfile, paste(outp, filename, sep="/"))
}
